package br.net.woodstock.tickettoride.client.beans;

import java.util.Date;

import br.net.woodstock.tickettoride.client.TicketRequest;

public class DefaultTicketRequest implements TicketRequest {

	private String[]	destinations;

	private Date		expires;

	private byte[]		data;

	public DefaultTicketRequest(final String destination, final int expires, final byte[] data) {
		this(new String[] { destination }, expires, data);
	}

	public DefaultTicketRequest(final String[] destinations, final int expires, final byte[] data) {
		super();
		this.destinations = destinations;
		this.data = data;

		long time = System.currentTimeMillis();
		time += expires * 60 * 1000;
		this.expires = new Date(time);
	}

	public DefaultTicketRequest(final String destination, final Date expires, final byte[] data) {
		this(new String[] { destination }, expires, data);
	}

	public DefaultTicketRequest(final String[] destinations, final Date expires, final byte[] data) {
		super();
		this.destinations = destinations;
		this.expires = expires;
		this.data = data;
	}

	@Override
	public String[] getDestinations() {
		return this.destinations;
	}

	@Override
	public Date getExpires() {
		return this.expires;
	}

	@Override
	public byte[] getData() {
		return this.data;
	}

}
